<?
	include("../includes/main_inc.php");

?><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Affiliate Bubble Administration</title>

<link href="<?=$rootdir?>css/admin.css" rel="stylesheet" type="text/css">
<script src="<?=$rootdir?>jscript/menuArray.js" language="javascript"></script>
<script src="<?=$rootdir?>jscript/clock.js" language="javascript"></script>

<script language="JavaScript" src="<?=$rootdir?>jscript/calendar1.js"></script><!-- Date only with year scrolling -->
</head>

<body onLoad="funClock();">
<?php include("../includes/header.php"); ?>
<table width="100%" border="0" cellspacing="25" cellpadding="0">
<tr>
<td valign="top" width="240"><div id="menu"><?php include("../menu.php"); ?></div></td>
<td align="left" valign="top">

<div id="title">
Export Member Details
</div>

<div id="search"> 
Enter export criteria.<br>
<form action="export-results.php" target="_blank" name="form1"  method="post">
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110">Date Range: </td>
<td><input name="SFrom" type="text" class="formFields" id="SFrom" value="<?=($_POST['SFrom'] ? $_POST['SFrom'] :date("d-m-Y"));?>" size="10">
          <strong><a href="javascript:cal1.popup();"><img src="<?=$rootdir?>jscript/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date" /></a></strong></td>
</td>
<td width="20" align="center">to</td>
<td><input name="STo" type="text" class="formFields" id="STo" value="<?=($_POST['STo'] ? $_POST['STo'] :date("d-m-Y"));?>" size="10">
          <strong><a href="javascript:cal2.popup();"><img src="<?=$rootdir?>jscript/img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date" /></a></strong></td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110">Sort By: </td>
<td><select name="SOrder" class="formFields">
<?
$m_arg = $r->RawQuery("SHOW COLUMNS FROM members");
			//$this->ValidArray = mysql_fetch_array(mysql_query($m_arg));
			while ($myrow = mysql_fetch_row($m_arg)) {
				echo"<option value='$myrow[0]'>$myrow[0]</option>";
			};
?>
</select></td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110">Included Fields:<br>
(ctrl for multiple)  </td>
<td><select name="IFields[]" size="7" multiple class="selectBox">
<?
$m_arg = $r->RawQuery("SHOW COLUMNS FROM members");
			//$this->ValidArray = mysql_fetch_array(mysql_query($m_arg));
			while ($myrow = mysql_fetch_row($m_arg)) {
				echo"<option value='$myrow[0]'>$myrow[0]</option>";
			};
?>
</select></td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110">Email Opt In:  </td>
<td><select name="OptVal" class="formFields">
<option value="all" selected>Export All Members</option>
<option value="yes">Export Members that HAVE opted in for email marketing</option>
<option  value="no">Export Members that HAVE NOT opted in for email marketing</option>
<option>HTML</option>
</select>
</td>
</tr>
</table>
<br>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="110">Select Export Format: </td>
<td><select name="EType" class="formFields">
<option>Make Your Selection</option>
<option value="csv">CSV File</option>
<option value="html">HTML</option>
<option value="xml">XML</option>
</select>
</td>
</tr>
</table>
<p align="right"><input type="submit" name="Submit" value="Export Members" class="formButtons">
</p>
</div>
</form>

<div id="content">Export produced<strong> 1028 results</strong></div>

</td>
</tr>
</table>
<script language="JavaScript">
<!-- // create calendar object(s) just after form tag closed
	 // specify form element as the only parameter (document.forms['formname'].elements['inputname']);
	 // note: you can have as many calendar objects as you need for your application
	var cal1 = new calendar1(document.forms['form1'].elements['SFrom']);
	cal1.year_scroll = true;
	cal1.time_comp = false;
	var cal2 = new calendar1(document.forms['form1'].elements['STo']);
	cal2.year_scroll = true;
	cal2.time_comp = false;
	
	

//-->
</script>
</body>
</html>
